const common=require('./webpack.common')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const {merge}=require('webpack-merge')
const { CleanWebpackPlugin}=require('clean-webpack-plugin')
const CopyWebpackPlugin=require('copy-webpack-plugin')
module.exports = merge(common,{
    mode:'production',
    
    plugins:[
        new CleanWebpackPlugin(),
        new CopyWebpackPlugin(
            {
            patterns: [
                'public'
                // { from: 'public', to: path.join(__dirname,'./dist/public') }
              ],
        }
        ),
        new UglifyJsPlugin({
            test: /\.js($|\?)/i
        }),
        
    ]
})